import request from '@/utils/request'
import { praseStrEmpty } from "@/utils/ruoyi";

// 查询危废列表
export function listWaste(query) {
    return request({
        url: '/system/wasteDetail/list',
        method: 'get',
        params: query
    })
}

// 查询危废详细
export function getWasteDetail(wasteID) {
    return request({
        url: '/system/wasteDetail/' + praseStrEmpty(wasteID),
        method: 'get'
    })
}

// 新增危废
export function addWaste(data) {
    return request({
        url: '/system/wasteDetail',
        method: 'post',
        data: data
    })
}

// 修改危废
export function updateWaste(data) {
    return request({
        url: '/system/wasteDetail',
        method: 'put',
        data: data
    })
}

// 删除危废
export function delWaste(wasteID) {
    return request({
        url: '/system/wasteDetail/' + wasteID,
        method: 'delete'
    })
}

// 导出危废
export function exportWaste(query) {
    return request({
        url: '/system/wasteDetail/export',
        method: 'get',
        params: query
    })
}

// 危废状态修改
export function changeUserStatus(wasteID, status) {
    const data = {
        wasteID,
        status
    }
    return request({
        url: '/system/wasteDetail/changeStatus',
        method: 'put',
        data: data
    })
}